#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>

void handler(int signo)
{
    std::cout << "get a new signal: " << signo << std::endl;
    exit(1);
}

int main()
{
    //信号捕捉:
    //1.默认捕捉
    //2.忽略
    //3.自定义
    ::signal(2,handler);
    while(true)
    {
        pause();
    }    
    return 0;
}
